package com.atguigu.factorymethod;

/**
 * @ClassName Pizaa
 * @Description TODO
 * @Author HongJian-Yang
 * @Date 2020/6/17 0:23
 * @Version 1.0
 */
public abstract class Pizza {
    protected String name;

    /**
     * 准备原材料,不同的Pizza原材料不一样,设置成抽象方法,留给子类重写
     */
    public abstract void prepare();

    public void bake() {
        System.out.println(name + " 正在烘烤");
    }

    public void cut() {
        System.out.println(name + " 正在剪切");
    }

    public void box() {
        System.out.println(name + " 正在打包");
    }

    public Pizza setName(String name) {
        this.name = name;
        return this;
    }
}
